package com.hnas.ecard.mapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.hnas.core.mapper.Mapper;
import com.hnas.ecard.orm.CommoditMrch;
import com.hnas.ecard.service.dto.DTOCommoditMrch;

public class CommoditMrchMapper extends Mapper<DTOCommoditMrch,CommoditMrch>{

    private static CommoditMrchMapper mapper;

	
	private CommoditMrchMapper(){
		super(DTOCommoditMrch.class,CommoditMrch.class);
	}
	
	public static CommoditMrchMapper getInstance(){
		if(mapper == null){
			mapper = new CommoditMrchMapper();
		}
		return mapper;
	}
	
	public DTOCommoditMrch mapToValue(CommoditMrch vo){
		DTOCommoditMrch dto = new DTOCommoditMrch();
		BeanUtils.copyProperties(vo, dto);
		return dto;
	}
	
	public List<DTOCommoditMrch> mapToValue(List<CommoditMrch> list){
		List<DTOCommoditMrch> dtoList = new ArrayList<DTOCommoditMrch>();
		for(CommoditMrch vo : list){
			DTOCommoditMrch dto = mapToValue(vo);
			dtoList.add(dto);
		}
		return dtoList;
	}
}
